/* Linduino Arduino emmulation library for linux
 * @author: Ralph Doncaster
 * @version: $Id:$
 */

#ifndef _ARDUINO_H_
#define _ARDUINO_H_

#include <stdio.h>
#include <stdint.h>
#include <unistd.h>
#include <sys/io.h>

#include "binary.h"

#include "wiring.h"

typedef uint8_t boolean;
typedef uint8_t byte;

#define INPUT 0x0
#define OUTPUT 0x1
#define INPUT_PULLUP 0x2

#define true 0x1
#define false 0x0

class SerialIO{
public:
	inline static void begin(int) {}	/* do nothing */
	inline static void print(byte c) { putchar(c); }
	inline static void flush() { fflush(stdout); }
};

void setup();
void loop();

/* time functions */
inline void delay(int ms) {usleep (ms * 1000);}

extern SerialIO Serial;

#endif /* _ARDUINO_H_ */
